package com.central.scheduler.master.dispatch.host;

import com.central.scheduler.master.dispatch.host.assign.HostWorker;
import com.central.scheduler.master.dispatch.host.assign.RandomSelector;

import java.util.Collection;

/**
 * @author Tindy
 * @date 2021/12/21
 * @describe
 *  random host manager
 */
public class RandomHostManager extends CommonHostManager {

    /**
     * selector
     */
    private final RandomSelector selector;

    /**
     * set round robin
     */
    public RandomHostManager() {
        this.selector = new RandomSelector();
    }

    @Override
    public HostWorker select(Collection<HostWorker> nodes) {
        return selector.select(nodes);
    }

}
